 <SCRIPT src="scripts/floater_xlib.js" type=text/javascript></SCRIPT>


<SCRIPT type=text/javascript>

var slideTime = 700;
var floatAtBottom = false;

function pepsi_floating_init()
{
	xMoveTo('floating_banner_right', 887 - (1024-screen.width), 0);

	winOnResize(); // set initial position
	xAddEventListener(window, 'resize', winOnResize, false);
	xAddEventListener(window, 'scroll', winOnScroll, false);
}
function winOnResize() {
	checkScreenWidth();
	winOnScroll(); // initial slide
}
function winOnScroll() {
  var y = xScrollTop()+80;
  if (floatAtBottom) {
    y += xClientHeight() - xHeight('floating_banner_left');
  }
  var phai=(screen.width-1000)/2;
  //alert(screen.width);
  xSlideTo('floating_banner_left', phai-165 , y, slideTime);  // Chỉnh khoảng cách bên trái
  xSlideTo('floating_banner_right', 1000+phai-9, y, slideTime); // // Chỉnh khoảng cách bên Phải
}
	
function checkScreenWidth()
{
	if( document.body.clientWidth < 1024 )
	{	
		document.getElementById('floating_banner_left').style.display = 'none';
		document.getElementById('floating_banner_right').style.display = 'none';
	}
	else
	{
		document.getElementById('floating_banner_left').style.display = '';
		document.getElementById('floating_banner_right').style.display = '';	
	}
}

</SCRIPT>
 <div id="floating_banner_left" style="text-align:right; position:absolute; overflow:hidden; top: 100px; left: 0px; width: 155px; border: 0px solid #000;">
<div id="floating_banner_left_content">
	<?
		$quangcao_index=$t->layquangcao(2);
		while($row_qc=mysql_fetch_assoc($quangcao_index)){
	?>
    <? if($row_qc['file']!=''){?>
    <p><a href="<?=$row_qc['url']?>" target="_blank"><img src="<?=$row_qc['file']?>" border="0" width="150" alt="" /></a></p>
    <? }}?>
   
</div>
</div>



<div id="floating_banner_right" style="text-align:left; position:absolute; overflow:hidden; top: 0px; right: -10px; width: 155px; border: 0px solid #000;">
	<div id="floating_banner_right_content"  >
    <?
		$quangcao_index=$t->layquangcao(3);
		while($row_qc=mysql_fetch_assoc($quangcao_index)){
	?>
    <? if($row_qc['file']!=''){?>
     <p><a href="<?=$row_qc['url']?>" target="_blank"><img src="<?=$row_qc['file']?>" border="0" width="150" alt="" /></a></p>
    <? }}?>
    
</div>
</div>
<script>
	pepsi_floating_init();
</script>